#include "CBaseCombatWeapon.h"

int CBaseCombatWeapon::GetWeaponId()
{
	typedef int (__thiscall* GetWeaponId_t)(void* pThis);
	return VMTWrapper::getfunction<GetWeaponId_t>(this, 366)(this);
}

int CBaseCombatWeapon::GetAmmoInClip()
{
	 return *(int*)((DWORD)this + Offsets::m_iClip1);
}

bool CBaseCombatWeapon::IsReady()
{
	int ammo = *(int*)((DWORD)this + Offsets::m_iClip1);
	return (ammo != 0);
}

float CBaseCombatWeapon::GetSpread()
{
	typedef float (__thiscall* GetSpread_t)(void* pThis);
	return VMTWrapper::getfunction<GetSpread_t>(this, 377)(this);
}

float CBaseCombatWeapon::GetInaccuracy()
{
	typedef float (__thiscall* GetInaccuracy_t)(void* pThis);
	return VMTWrapper::getfunction<GetInaccuracy_t>(this, 378)(this);
}

void CBaseCombatWeapon::UpdateAccuracyPenalty()
{
	typedef void (__thiscall* UpdateAccuracyPenalty_t)(void* pThis);
	VMTWrapper::getfunction<UpdateAccuracyPenalty_t>(this, 379)(this);
} 

DWORD CBaseCombatWeapon::GetOwner()
{
	return *(DWORD*)((DWORD)this + Offsets::m_hOwner);
}